import { defaultRequest as rq } from "./request";
import type { R } from "./request";

export const tracesApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${GATEWAY_URL}/backend-bsms/tracker/metric/page/termsTraceId", { params });
};

export const spansApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${GATEWAY_URL}/backend-bsms/tracker/metric/spans", { params });
};

export const spansTreeApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${GATEWAY_URL}/backend-bsms/tracker/metric/spans/tree", { params });
};

export const testTraceApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${GATEWAY_URL}/backend-bsms/test/trace", { params });
};